from rest_framework import serializers
from drf_extra_fields.fields import Base64ImageField


class TokenResponse(serializers.Serializer):
    success = serializers.BooleanField()
    token = serializers.CharField()
    isAdmin = serializers.BooleanField()


class MessageResponse(serializers.Serializer):
    success = serializers.BooleanField()
    message = serializers.CharField()


class TourResponse(serializers.Serializer):
    id = serializers.IntegerField()
    name = serializers.CharField()
    description = serializers.CharField()
    price = serializers.IntegerField()
    seats = serializers.IntegerField()
    isActive = serializers.BooleanField()
    image = Base64ImageField()
    arrivalDate = serializers.DateTimeField()
    departureDate = serializers.DateTimeField()
    isPaid = serializers.BooleanField(required=False)
    isBook = serializers.BooleanField(required=False)
    availableSeats = serializers.IntegerField()


class UserTourResponse(TourResponse):
    isPaid = serializers.BooleanField()


class UserResponse(serializers.Serializer):
    id = serializers.IntegerField()
    first_name = serializers.CharField()
    last_name = serializers.CharField()
    email = serializers.CharField()
    isAdmin = serializers.BooleanField()


class AllUsersResponse(serializers.Serializer):
    id = serializers.IntegerField()
    first_name = serializers.CharField()
    last_name = serializers.CharField()
    email = serializers.CharField()
    isPaid = serializers.BooleanField()